package com.google.code.roztocze358.server.businessobjects;

import java.io.Serializable;

/**
 * Single card
 * 
 * @author Piotr.Paradzinski
 */
public class Card implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private Suite suite = null;
	
	private Face face = null;

	public Card(Suite suite, Face face) {
		super();
		this.suite = suite;
		this.face = face;
	}

	public void setSuite(Suite suite) {
		this.suite = suite;
	}

	public Face getFace() {
		return face;
	}

	public void setFace(Face face) {
		this.face = face;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((face == null) ? 0 : face.hashCode());
		result = prime * result + ((suite == null) ? 0 : suite.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Card other = (Card) obj;
		if (face == null) {
			if (other.face != null)
				return false;
		} else if (!face.equals(other.face))
			return false;
		if (suite == null) {
			if (other.suite != null)
				return false;
		} else if (!suite.equals(other.suite))
			return false;
		return true;
	}

}
